<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: ActionView::Template</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">ActionView::Template</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../files/vendor/rails/actionpack/lib/action_view/template_rb.html">
                vendor/rails/actionpack/lib/action_view/template.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                <a href="../Object.html">
                Object
               </a>
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">



   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M002170">content_type</a>&nbsp;&nbsp;
      <a href="#M002168">format_and_extension</a>&nbsp;&nbsp;
      <a href="#M002177">method_segment</a>&nbsp;&nbsp;
      <a href="#M002171">mime_type</a>&nbsp;&nbsp;
      <a href="#M002169">multipart?</a>&nbsp;&nbsp;
      <a href="#M002167">new</a>&nbsp;&nbsp;
      <a href="#M002172">path</a>&nbsp;&nbsp;
      <a href="#M002173">path_without_extension</a>&nbsp;&nbsp;
      <a href="#M002174">path_without_format_and_extension</a>&nbsp;&nbsp;
      <a href="#M002175">relative_path</a>&nbsp;&nbsp;
      <a href="#M002178">render_template</a>&nbsp;&nbsp;
      <a href="#M002176">source</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->
    <div id="includes">
      <h3 class="section-bar">Included Modules</h3>

      <div id="includes-list">
        <span class="include-name">Renderable</span>
      </div>
    </div>

    <div id="section">





    <div id="attribute-list">
      <h3 class="section-bar">Attributes</h3>

      <div class="name-list">
        <table>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">base_path</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">extension</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">filename</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">format</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">load_path</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">name</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        </table>
      </div>
    </div>
      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Class methods</h3>

      <div id="method-M002167" class="method-detail">
        <a name="M002167"></a>

        <div class="method-heading">
          <a href="#M002167" class="method-signature">
          <span class="method-name">new</span><span class="method-args">(template_path, load_paths = [])</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M002167-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M002167-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_view/template.rb, line 12</span>
12:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">template_path</span>, <span class="ruby-identifier">load_paths</span> = [])
13:       <span class="ruby-identifier">template_path</span> = <span class="ruby-identifier">template_path</span>.<span class="ruby-identifier">dup</span>
14:       <span class="ruby-ivar">@base_path</span>, <span class="ruby-ivar">@name</span>, <span class="ruby-ivar">@format</span>, <span class="ruby-ivar">@extension</span> = <span class="ruby-identifier">split</span>(<span class="ruby-identifier">template_path</span>)
15:       <span class="ruby-ivar">@base_path</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/\/$/</span>, <span class="ruby-value str">''</span>) <span class="ruby-comment cmt"># Push to split method</span>
16:       <span class="ruby-ivar">@load_path</span>, <span class="ruby-ivar">@filename</span> = <span class="ruby-identifier">find_full_path</span>(<span class="ruby-identifier">template_path</span>, <span class="ruby-identifier">load_paths</span>)
17: 
18:       <span class="ruby-comment cmt"># Extend with partial super powers</span>
19:       <span class="ruby-identifier">extend</span> <span class="ruby-constant">RenderablePartial</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@name</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^_/</span>
20:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M002170" class="method-detail">
        <a name="M002170"></a>

        <div class="method-heading">
          <a href="#M002170" class="method-signature">
          <span class="method-name">content_type</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M002170-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M002170-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_view/template.rb, line 31</span>
31:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">content_type</span>
32:       <span class="ruby-identifier">format</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-value str">'.'</span>, <span class="ruby-value str">'/'</span>)
33:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M002168" class="method-detail">
        <a name="M002168"></a>

        <div class="method-heading">
          <a href="#M002168" class="method-signature">
          <span class="method-name">format_and_extension</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M002168-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M002168-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_view/template.rb, line 22</span>
22:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">format_and_extension</span>
23:       (<span class="ruby-identifier">extensions</span> = [<span class="ruby-identifier">format</span>, <span class="ruby-identifier">extension</span>].<span class="ruby-identifier">compact</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;.&quot;</span>)).<span class="ruby-identifier">blank?</span> <span class="ruby-value">? </span><span class="ruby-keyword kw">nil</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">extensions</span>
24:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M002177" class="method-detail">
        <a name="M002177"></a>

        <div class="method-heading">
          <a href="#M002177" class="method-signature">
          <span class="method-name">method_segment</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M002177-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M002177-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_view/template.rb, line 67</span>
67:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">method_segment</span>
68:       <span class="ruby-identifier">relative_path</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/([^a-zA-Z0-9_])/</span>) { <span class="ruby-identifier">$1</span>.<span class="ruby-identifier">ord</span> }
69:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M002171" class="method-detail">
        <a name="M002171"></a>

        <div class="method-heading">
          <a href="#M002171" class="method-signature">
          <span class="method-name">mime_type</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M002171-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M002171-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_view/template.rb, line 35</span>
35:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">mime_type</span>
36:       <span class="ruby-constant">Mime</span><span class="ruby-operator">::</span><span class="ruby-constant">Type</span>.<span class="ruby-identifier">lookup_by_extension</span>(<span class="ruby-identifier">format</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">format</span>
37:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M002169" class="method-detail">
        <a name="M002169"></a>

        <div class="method-heading">
          <a href="#M002169" class="method-signature">
          <span class="method-name">multipart?</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M002169-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M002169-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_view/template.rb, line 27</span>
27:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">multipart?</span>
28:       <span class="ruby-identifier">format</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">format</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">'.'</span>)
29:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M002172" class="method-detail">
        <a name="M002172"></a>

        <div class="method-heading">
          <a href="#M002172" class="method-signature">
          <span class="method-name">path</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M002172-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M002172-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_view/template.rb, line 40</span>
40:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">path</span>
41:       [<span class="ruby-identifier">base_path</span>, [<span class="ruby-identifier">name</span>, <span class="ruby-identifier">format</span>, <span class="ruby-identifier">extension</span>].<span class="ruby-identifier">compact</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">'.'</span>)].<span class="ruby-identifier">compact</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">'/'</span>)
42:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M002173" class="method-detail">
        <a name="M002173"></a>

        <div class="method-heading">
          <a href="#M002173" class="method-signature">
          <span class="method-name">path_without_extension</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M002173-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M002173-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_view/template.rb, line 45</span>
45:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">path_without_extension</span>
46:       [<span class="ruby-identifier">base_path</span>, [<span class="ruby-identifier">name</span>, <span class="ruby-identifier">format</span>].<span class="ruby-identifier">compact</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">'.'</span>)].<span class="ruby-identifier">compact</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">'/'</span>)
47:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M002174" class="method-detail">
        <a name="M002174"></a>

        <div class="method-heading">
          <a href="#M002174" class="method-signature">
          <span class="method-name">path_without_format_and_extension</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M002174-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M002174-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_view/template.rb, line 50</span>
50:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">path_without_format_and_extension</span>
51:       [<span class="ruby-identifier">base_path</span>, <span class="ruby-identifier">name</span>].<span class="ruby-identifier">compact</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">'/'</span>)
52:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M002175" class="method-detail">
        <a name="M002175"></a>

        <div class="method-heading">
          <a href="#M002175" class="method-signature">
          <span class="method-name">relative_path</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M002175-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M002175-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_view/template.rb, line 55</span>
55:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">relative_path</span>
56:       <span class="ruby-identifier">path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">filename</span>)
57:       <span class="ruby-identifier">path</span>.<span class="ruby-identifier">sub!</span>(<span class="ruby-node">/^#{Regexp.escape(File.expand_path(RAILS_ROOT))}\//</span>, <span class="ruby-value str">''</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">defined?</span>(<span class="ruby-constant">RAILS_ROOT</span>)
58:       <span class="ruby-identifier">path</span>
59:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M002178" class="method-detail">
        <a name="M002178"></a>

        <div class="method-heading">
          <a href="#M002178" class="method-signature">
          <span class="method-name">render_template</span><span class="method-args">(view, local_assigns = {})</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M002178-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M002178-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_view/template.rb, line 72</span>
72:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">render_template</span>(<span class="ruby-identifier">view</span>, <span class="ruby-identifier">local_assigns</span> = {})
73:       <span class="ruby-identifier">render</span>(<span class="ruby-identifier">view</span>, <span class="ruby-identifier">local_assigns</span>)
74:     <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
75:       <span class="ruby-identifier">raise</span> <span class="ruby-identifier">e</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">filename</span>
76:       <span class="ruby-keyword kw">if</span> <span class="ruby-constant">TemplateError</span> <span class="ruby-operator">===</span> <span class="ruby-identifier">e</span>
77:         <span class="ruby-identifier">e</span>.<span class="ruby-identifier">sub_template_of</span>(<span class="ruby-keyword kw">self</span>)
78:         <span class="ruby-identifier">raise</span> <span class="ruby-identifier">e</span>
79:       <span class="ruby-keyword kw">else</span>
80:         <span class="ruby-identifier">raise</span> <span class="ruby-constant">TemplateError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword kw">self</span>, <span class="ruby-identifier">view</span>.<span class="ruby-identifier">assigns</span>, <span class="ruby-identifier">e</span>)
81:       <span class="ruby-keyword kw">end</span>
82:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M002176" class="method-detail">
        <a name="M002176"></a>

        <div class="method-heading">
          <a href="#M002176" class="method-signature">
          <span class="method-name">source</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M002176-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M002176-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_view/template.rb, line 62</span>
62:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">source</span>
63:       <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">filename</span>)
64:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>